package com.famdoc.Mapper;

import com.famdoc.Pojo.entity.CheckBody;
import com.famdoc.Pojo.entity.CheckItem;
import com.famdoc.Pojo.entity.Patient;
import com.famdoc.Pojo.entity.Visit;
import com.famdoc.Pojo.vo.VisitCheckItem;
import com.famdoc.Pojo.vo.VisitVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface VisitMapper {
    int addVisit(Visit visit);

    List<VisitVO> searchVisitByKeyword(@Param("keyword") String keyword,
                                       @Param("doctorId") int doctorId);

    List<VisitVO> getVisitList(@Param("doctorId") int doctorId,
                               @Param("start") int start,
                               @Param("pageSize") int pageSize);

    int getDraftNum(@Param("doctorId")int doctorId);

    int getCompletedNum(@Param("doctorId")int doctorId);

    List<VisitVO> flierVisitByDate(@Param("doctorId")int doctorId,
                                   @Param("startDate")LocalDateTime startDate,
                                   @Param("endDate")LocalDateTime endDate);

    int updateVisit(Visit visit);

    int deleteVisit(@Param("id")int id);

    List<Patient> getSignPatient(@Param("doctorId")int doctorId,
                                 @Param("keyword")String keyword,
                                 @Param("start")int start,
                                 @Param("pageSize")int pageSize);

    VisitCheckItem getVisitCheckItem(@Param("checkId")int checkId);

    int addCheckItem(CheckItem checkItem);

    int addCheck(CheckBody checkBody);

    int deleteCheck(@Param("checkId")int checkId);

    int deleteCheckItem(@Param("checkItemId")int checkItemId);

    Patient getPatient(@Param("patientId")int patientId);

    int updateCheckItem(CheckItem checkItem);

    int updateCheck(CheckBody checkBody);

    List<VisitCheckItem> getCheckItemList(Integer patientId);

    Visit getVisitById(@Param("visitId")int visitId);

    void updateVisitStatusDue(@Param("visitId")int visitId);
}
